<template>
  <div class="Search">
    <el-card>
      <div slot="header">
        <div class="search-header">
          <span>线上热门搜索</span>
          <el-dropdown>
            <span>
              <i class="el-icon-more" />
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item>黄金糕</el-dropdown-item>
              <el-dropdown-item>狮子头</el-dropdown-item>
              <el-dropdown-item>螺蛳粉</el-dropdown-item>
              <el-dropdown-item>双皮奶</el-dropdown-item>
              <el-dropdown-item>蚵仔煎</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </div>
      </div>
      <div class="search-body">
        <el-row :gutter="10">
          <el-col :span="12">
            <LineChart />
          </el-col>
          <el-col :span="12">
            <LineChart />
          </el-col>
        </el-row>
        <!-- table表格 -->
        <el-table border :data="tableData" style="width: 100%" class="table">
          <el-table-column prop="date" label="排名" width="80" align="center">
            <template v-slot="{ $index }">
              {{ $index + 1 }}
            </template>
          </el-table-column>
          <el-table-column prop="name" label="搜索关键字" width="180" />
          <el-table-column prop="address" label="用户数" sortable />
          <el-table-column prop="address" label="周涨幅" sortable />
        </el-table>
        <!-- 分页器 -->
        <el-pagination layout="prev, pager, next" :total="1000" class="pagination"/>
      </div>
    </el-card>
  </div>
</template>

<script>
import LineChart from './lineChart/index'
export default {
  name: 'Search',
  components: {
    LineChart
  },
  data() {
    return {
      tableData: [{}, {}, {}, {}]
    }
  },
  methods: {
    formatter(row, column) {
      return row.address
    }
  }
}
</script>

<style scoped lang="scss">
.Search {
  .search-header {
    display: flex;
    justify-content: space-between;
  }
  .search-body {
    .table {
      margin-top: 20px;
    }
    .pagination{
        float: right;
        margin:10px 0;
    }
  }
}
</style>
